Skip to content

Specialize instantiated_t for std::tuple to improve performance#32

Merged
mingxwa merged 3 commits intongcpp:mainfrom
Kim-J-Smith:perf/add-instantiated_traits_helper
Apr 26, 2026
Merged

Specialize instantiated_t for std::tuple to improve performance#32
mingxwa merged 3 commits intongcpp:mainfrom
Kim-J-Smith:perf/add-instantiated_traits_helper

Conversation

@Kim-J-Smith
Copy link
Copy Markdown
Contributor

Summary

Add a std::tuple specialization to instantiated_t to improve compile-time performance, as discussed in #30.

The new implementation uses instantiated_traits_helper that forwards to the generic path except for std::tuple, where it directly unpacks the types.

Performance

Benchmarks show significant improvements, especially with many conventions:

Conventions Old (μs) New (μs) Improvement
3 28,248 25,756 +9.7%
10 50,087 38,855 +28.9%
30 155,814 91,322 +70.6%
100 1,711,836 387,900 +341.3%
200 10,181,265 1,066,715 +854.5%

Testing

No new unit tests required -- the std::tuple case is already covered by existing usage.

@mingxwa mingxwa added the enhancement New feature or request label Apr 26, 2026
Copy link
Copy Markdown
Collaborator

@mingxwa mingxwa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread include/proxy/v4/proxy.h Outdated
Copy link
Copy Markdown
Collaborator

@mingxwa mingxwa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! This is a practical improvement in compile speed. Great work!

@mingxwa mingxwa merged commit dbf2425 into ngcpp:main Apr 26, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants